# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=File-Next
pkgname=perl-${_realname}
pkgver=1.12
pkgrel=2
pkgdesc="File-finding iterator"
arch=('any')
license=('PerlArtistic' 'GPL')
url="http://search.cpan.org/dist/${_realname}"
groups=('perl-modules')
depends=('perl')
options=(!emptydirs)
source=("http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/${_realname}-${pkgver}.tar.gz")
md5sums=('725e888d1600fed62cd89b9dac989304')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  PERL_MM_USE_DEFAULT=1 PERL5LIB="" \
  PERL_AUTOINSTALL=--skipdeps \
  PERL_MM_OPT="INSTALLDIRS=vendor" \
  PERL_MB_OPT="--installdirs vendor" \
  MODULEBUILDRC=/dev/null \
    /usr/bin/perl Makefile.PL

  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  PERL_MM_USE_DEFAULT=1 PERL5LIB="" make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install DESTDIR="${pkgdir}"
  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
